package com.acceptable.qucun.file.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class FileInfo {
    private Long fileId;
    private String fileName = "新建文件";
    private Long fileSize = 0L;
    private String fileMime;
    private String fileSource;

    private boolean isDict;
    private boolean isDeleted;
    private boolean isChecked;

    private String createTime;
    private String lastModifyTime;

    // 删除时的时刻
    private String deleteTime;

    // 彻底进行物理删除的时间
    private String expireTime;

    private List<FileInfo> pathDictList;
    private List<FileInfo> subFileList;
    private String shareStatus;
    private Integer shareId;
    private static Map<String, String> sourceMap = new HashMap<>();

    static {
        sourceMap.put("NO", "自行上传");
        sourceMap.put("TO_OTHER", "自行上传");
        sourceMap.put("TO_ME", "分享给我");
    }

    public void setFileSource(String value){
       this.fileSource = sourceMap.get(value);
    }

    public boolean getIsDict() {
        return isDict;
    }

    public void setIsDict(boolean dict) {
        isDict = dict;
    }

    public boolean getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(boolean deleted) {
        isDeleted = deleted;
    }

    public boolean getIsChecked() {
        return isChecked;
    }

    public void setIsChecked(boolean isChecked){
        this.isChecked = isChecked;
    }

    public void setDeleteTime(String timeStr){
        this.deleteTime = timeStr;
    }

}

